<!DOCTYPE html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8"/>
    <title>厅干部平时考核管理系统</title>
    <link rel="stylesheet" type="text/css" href="<c:url value='/resource/jxkh/css/main.css'/>"/>
    <script type="text/javascript" src="<c:url value='/resource/jxkh/js/jquery-1.11.0.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/resource/jxkh/js/jquery.form.js'/>"></script>
    <!--弹出框-->
    <script type="text/javascript" src="<c:url value='/resource/jxkh/js/layer/layer.js'/>" ></script>
    <script>
        function submitForm() {
            $("#submit_form").ajaxSubmit({
                type: "post",
                dataType: "json",
                success: function (data) {
                    if (data.data.status == 1) {
                        parent.$('#boot_table').bootstrapTable('refresh');
                        parent.showMessage("操作成功！");
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index);
                    } else {
                        parent.showMessage(data.data.body);
                    }
                },
                error: function () {
                    parent.showMessage("失败！");
                }
            });
        }
        $(function(){
            //下拉框
            $(document).click(function() {
                $(".row_select_xl").slideUp(200);
                $(".khybj_select_xl").slideUp(200);
            });
            $(".row_select").click(function(e) {
                e = e || window.event;
                if(e.stopPropagation) {
                    e.stopPropagation();
                } else {
                    e.cancelBubble = true;
                }
                $(this).children(".row_select_xl").slideToggle(200);
                $(this).parents("td").siblings("td").find(".row_select_xl").hide();
                var selecttext = $(this).children("p");
                var selectmain = $(this).children(".row_select_xl");
                var lis = selectmain.find('li');
                for(var i = 0; i < lis.length; i++) {
                    lis[i].onclick = function() {
                        selectmain.hide();
                        var textval = $(this).html();
                        selecttext.text(decodeURIComponent(textval));
                    }
                }
            });
            $(".row_select_xl li").click(function(e){
                e = e || window.event;
                if(e.stopPropagation) {
                    e.stopPropagation();
                } else {
                    e.cancelBubble = true;
                }
                $(this).parents(".row_select_xl").hide();
            });
            //
            $(".khybj_select").click(function(e) {
                e = e || window.event;
                if(e.stopPropagation) {
                    e.stopPropagation();
                } else {
                    e.cancelBubble = true;
                }
                $(this).children(".khybj_select_xl").slideToggle(200);
                $(this).parents("td").siblings("td").find(".khybj_select_xl").hide();
                var selecttext = $(this).children("p");
                var selectmain = $(this).children(".khybj_select_xl");
                var lis = selectmain.find('li');
                for(var i = 0; i < lis.length; i++) {
                    lis[i].onclick = function() {
                        selectmain.hide();
                        var textval = $(this).html();
                        selecttext.text(decodeURIComponent(textval));
                        $("input[type=hidden][name=type]").val(decodeURIComponent(textval));
                    }
                }
            });
            $(".khybj_select_xl li").click(function(e){
                e = e || window.event;
                if(e.stopPropagation) {
                    e.stopPropagation();
                } else {
                    e.cancelBubble = true;
                }
                $(this).parents(".khybj_select_xl").hide();
            });
            //下拉框结束

            //单选框
            $(".row_rt_main .checkbox").click(function() {
                $(this).addClass("checkbox_hov").siblings(".checkbox").removeClass("checkbox_hov");
            });
            //单选框结束
        });
    </script>
</head>
<body>
<div class="njga" style="overflow: auto;">
    <form action="<c:url value='/khy/editKhyInfo.json'/>" method="post" id="submit_form">
    <!--考核域编辑-->
    <div class="date_pop" id="fksz_pop_bj" style="display: block;">
        <div class="khybj">
            <input type="hidden" name="dbid" value="${khy.dbid}"/>
            <div class="row">
                <div class="row_lf">考核域</div>
                <div class="row_rt">
                    <div class="row_rt_main_w">
                        <div class="row_rt_main">
                            <input type="text"value="${khy.name}" name="name"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="row_lf">考核类别</div>
                <div class="row_rt">
                    <div class="row_rt_main_w">
                        <div class="khybj_select">
                            <p>${khy.type}</p>
                            <input type="hidden" name="type" value="${khy.type}"/>
                            <div class="arrow_down"></div>
                            <ul class="khybj_select_xl">
                                <li>共性指标</li>
                                <li>业务指标</li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="row_lf">分数</div>
                <div class="row_rt">
                    <div class="row_rt_main_w">
                        <div class="row_rt_main">
                            <input type="text" value="${khy.score}" name="score"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="row_lf">A</div>
                <div class="row_rt">
                    <div class="row_rt_main_w">
                        <div class="row_rt_main">
                            <input type="text" value="${khy.amin}" name="amin"/>
                        </div>
                    </div>
                    <div class="zhi">至</div>
                    <div class="row_rt_main_w">
                        <div class="row_rt_main">
                            <input type="text" value="${khy.amax}" name="amax"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="row_lf">B</div>
                <div class="row_rt">
                    <div class="row_rt_main_w">
                        <div class="row_rt_main">
                            <input type="text" value="${khy.bmin}" name="bmin"/>
                        </div>
                    </div>
                    <div class="zhi">至</div>
                    <div class="row_rt_main_w">
                        <div class="row_rt_main">
                            <input type="text" value="${khy.bmax}" name="bmax"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="row_lf">C</div>
                <div class="row_rt">
                    <div class="row_rt_main_w">
                        <div class="row_rt_main">
                            <input type="text" value="${khy.cmin}" name="cmin"/>
                        </div>
                    </div>
                    <div class="zhi">至</div>
                    <div class="row_rt_main_w">
                        <div class="row_rt_main">
                            <input type="text" value="${khy.cmax}" name="cmax"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="row_lf">D</div>
                <div class="row_rt">
                    <div class="row_rt_main_w">
                        <div class="row_rt_main">
                            <input type="text" value="${khy.dmin}" name="dmin"/>
                        </div>
                    </div>
                    <div class="zhi">至</div>
                    <div class="row_rt_main_w">
                        <div class="row_rt_main">
                            <input type="text" value="${khy.dmax}" name="dmax"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="row_lf">状态</div>
                <div class="row_rt">
                    <input type="radio" name="status" value="1"/> 启用
                    <input type="radio" name="status" style="margin-left: 10px;" value="0"/> 禁用
                </div>
            </div>
        </div>
    </div>
    <!--考核域编辑结束-->
    </form>
</div>
<script>
    $(function(){
        var zt = ${khy.status};
        if(zt==1){
            $("input[type=radio][name=status][value='1']").attr('checked',true);
        }else{
            $("input[type=radio][name=status][value='0']").attr('checked',true);
        }
    });
</script>
</body>
